home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Games / Game Sample Code / ZAM 1.0a13 / CoreSource / AdjustMenus.c next >
Encoding:
C/C++ Source or Header  |  1993-09-16  |  704 b   |  33 lines  |  [TEXT/KAHL]

  1. /*
  2.     AdjustMenus.c
  3.     
  4.     This procedure contains code to adjust the menus before MenuSelect or MenuKey is called.
  5. */
  6.  
  7.  
  8. #include "MenuDispatch.h"
  9. #include "CoreGlobals.h"
  10.  
  11.  
  12. void AdjustMenus(void)
  13. {
  14.  
  15.     WindowPtr    fWindow;
  16.     
  17.     fWindow = FrontWindow();
  18.     
  19.     /* If there is no open window then.... */
  20.     if(!fWindow) {
  21.         DisableItem ( GetMHandle(FILE_MENU), FILE_CLOSE );
  22.     } else {
  23.         EnableItem ( GetMHandle(FILE_MENU), FILE_CLOSE );
  24.         /* LET THE DOCUMENT HAVE A CHANCE TO CHANGE MENUS */
  25.         AdjustMenuGameWindow(fWindow);
  26.     }
  27.  
  28.     
  29.     /* THESE ARE NOT IMPLEMENTED YET */
  30.     DisableItem ( GetMHandle(FILE_MENU), FILE_SAVE );
  31.     DisableItem ( GetMHandle(FILE_MENU), FILE_OPEN );
  32.     DisableItem ( GetMHandle(FILE_MENU), FILE_PRINT );
  33. }